#include "StompedReality/Core/Game.h"
#include "StompedReality/Core/MessageSystem/MessageSystem.h"
#include "StompedReality/Asset/TextureSystem.h"
#include "StompedReality/Asset/PatchSystem.h"
#include "StompedReality/Core/FileSystem.h"
#ifdef LINUX
#include "StompedReality/Core/Graphics/LinuxRenderSystem.h"
#elif WIN32
#include "StompedReality/Core/Graphics/Windows/WGLRenderSystem.h"
#endif
using namespace StompedReality;
int main ( int argc, char **argv )
{
	Game game;
	
#ifdef LINUX
	game.setRenderer(new StompedReality::Graphics::LinuxRenderSystem());
#elif WIN32
	game.setRenderer(new StompedReality::Graphics::WGLRenderSystem());
#endif
	
	game.ParseConfig( argv[1] );
	
	if (!game.IsInitialized())
		return -1;

	auto root = game.getFileSystem()->openAsJson( argv[1] );

	game.LoadObjects( root->get("Components",NULL ));
	
	game.loop();
	
	return 0;
}
